<div id="content">
     <h2>CALENDER FOR DATE: <?php echo $this->currendate;?><span id="datelist"></span></h2>
<div class="clear"></div>
</div> 
<div id="content">
	<?php if (!empty($this->cusList)):?>
		<?php
			$i=0; 
			foreach ($this->cusList as $item):?>
			<table  class="listBook" id="listBook<?php echo $item['appointment_id'] ?>" border="0"  cellspacing="0" cellpadding="0">           
		     <tr>
		          <td class="topborder customerheader" colspan="4">
		          <h2><?php echo $item['customer_fname']." ".$item['customer_lname'];?>
		          - <span class="cancel" rel="<?php echo $item['appointment_id']; ?>">Cancel</span>
		          - <a href="<?php echo $this->baseUrl()."/index/edit/id/".$item['appointment_id'];?>" class="edit">Edit</a></h2></td>
		     </tr>
		     <tr>
		          <td class="customernote" style="color: white;" colspan="4">
		          <?php echo $item['descriptions'];?>
		          </td>
		     </tr>
		     <?php echo $this->getDetailsAppoint($item['appointment_id']);?>
			</table>
		<?php
//		 	if (++$i==2) 
//		 	{
//		 		$i=0;
//		 		echo "<div class='clear'></div>";
//		 	}
			endforeach;
//			if ($i!=0) echo "<div class='clear'></div>";
		?>
	<?php endif;?>
	<div class='clear'></div>
</div> 

<script>

	$('.cancel').click(function(){
		 var where_to= confirm("Do you sure delete ?");
		 if (where_to== true)
		 {
			 var id = $(this).attr('rel');
				$('#listBook'+id).remove();
				url = "<?php echo $this->baseUrl()?>/index/cancelapp/id/"+id;
				$.get(
					    url,
						function(data) { 
						},
					    "html"
				);	
		 }
		});
	$('.delappdetail').click(function(){
		var where_to= confirm("Do you sure delete this row?");
		 if (where_to== true)
		 {
			 var id = $(this).attr('rel');
				$('#boxrow'+id).remove();
				url = "<?php echo $this->baseUrl()?>/index/cancelappdetail/id/"+id;
				$.get(
					    url,
						function(data) { 
						},
					    "html"
				);	
		 }
		
	});
</script>